package com.cqjtu.store.product.controller;

import com.cqjtu.store.common.R;
import com.cqjtu.store.product.pojo.vo.ProductCategoryVO;
import com.cqjtu.store.product.service.ProductCategoryService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("api/category")
@Slf4j
@CrossOrigin //允许跨域
public class ProductCategoryController {
    @Autowired
    private ProductCategoryService productCategoryService;
    /**
     * 查询分类
     * @return
     */
    @GetMapping("list")
    public R<List<ProductCategoryVO>> getList(){
        List<ProductCategoryVO> list = productCategoryService.getList();
        return R.ok(list);
    }

    //dev分支中新加的注释，

}
